{
语法百题 解题报告：
 http://git.oschina.net/et0662/sznoi-grammar/ 
}
var
	a,b:array of array of longint;
	i,j,k:integer;
	temp:longint;
	m,n,r:integer;
begin
	readln(m,n,r);
	setlength(a,m+1,n+1);
	setlength(b,n+1,r+1);
	for i:=1 to m do
	for j:=1 to n do
		read(a[i,j]);
	for i:=1 to n do
	for j:=1 to r do
		read(b[i,j]);
	writeln(m, ' ', r);
	for i:=1 to m do
	begin
		for j:=1 to r do
		begin
			temp:=0;
			for k:=1 to n do
				temp:=temp+a[i][k]*b[k][j];
			write(temp, ' ');
		end;
		writeln;
	end;
end.
